***************************************************************************************
*		Reproduction do file for: 											 		  *
*			Nils D. Steiner, Lucca Hoffeller, Yanick Gutheil & Tobias Wiesenfeldt 	  * 
* 			Class voting for radical-left parties in Western Europe:		 		  *
*			The libertarian vs. authoritarian class trade-off 					      *
* 			Party Politics							       					   		  *
***************************************************************************************

***** Instructions: To reproduce all results reported in the article and its appendix, run this do-file on the dataset "Reproduction_Class voting for RLPs.dta"
	// Note 1: For simplicity of reproduction we provide a processed version of the data compiled from the ESS and the CHES. 
	// Users interested in obtaining the do-files we used to pre-process and merge the data are invited to contact the corresponding author (Nils Steiner, steiner@politik.uni-mainz.de; steiner.nils@googlemail.com).  
	// Note 2: Parts of the estimations in the do-file take a very long time to estimate, especially the binary logit multilevel models and the margins based on those.
	// This part of the analysis is commented out in this version of the do-file.

	
**# Bookmark #1
********************************************************************************
******************* Settings and preparations **********************************
********************************************************************************
	clear all

/*
*** install ados and schemes, if necessary:
	ssc install estout, replace
	ssc install mplotoffset, replace
	ssc install blindschemes, replace
*/

*** settings
	version 17.0
	
*** graph settings
	set scheme plottig
	graph set window fontface "Times New Roman"

***** Open processed dataset
	clear
	use "Reproduction_Class voting for RLPs.dta"	

	
**# Bookmark #2
********************************************************************************
**************************** Descriptives **************************************
********************************************************************************
* RLP voting by class
	tab class80_7 voteRLP, row
	tab class80 voteRLP, row

* Figure B1: Distribution of occupational classes by country
	hist class80_7, discrete percent xlabel(1/7, valuelabel angle(090) labsize(medium)) ///
		addlabel addlabopts(yvarformat(%4.0f) mlabsize(small)) scale(*1.4) ysize(8) ///
		xtitle(" ", size(zero)) by(cntry, col(3) note(" ", size(zero)) legend(off)) ///
		name(FigureB1, replace)

		
*** Mixed descriptives at the RLP-election election		
	* Table A1: List of included parties with number of voters and GAL-TAN position
		preserve 
			collapse (last) cntry election_year country_elecyear party_id partylab (rawsum) voteRLP_tot=voteRLP (mean) voteRLP_share=voteRLP *filled (count) N=party_id, by(country_elecyear_party)
			
			* sample size per context
			sum N, detail
			
			* RLP voters per context
			sum voteRLP_tot voteRLP_share, d
			sort voteRLP_share
			list cntry partylab party_id election_year voteRLP_tot voteRLP_share galtan_filled
			
			* check between and within variation in GAL-TAN position
			xtset party_id election_year
			xtsum galtan_filled
			
			/*
			* distribution of absolute number of voter and vote shares
			 hist voteRLP_tot, discrete 
			 hist voteRLP_share, discrete 		
			*/
			* Export table A1 with RLPs vote numbers and shares per context
			sort cntry partylab election_year
			asdoc list cntry partylab party_id election_year voteRLP_tot voteRLP_share galtan_filled, save(./TableA1.rtf) replace

		
*** Figure 2: Class positions, RLP positions and class voting for RLPs across contexts 
	* Positions of RLPS in two-dimensional policy space
		scatter galtan_filled lrecon_filled, ///
			xlabel(0 (2.5) 10, gmin gmax) ylabel(0 (2.5) 10, gmin gmax) msymbol(X) msize(medium) ///
			ytitle(GAL-TAN position) xtitle(economic left-right position) ///
			yline(5) xline(5) ///
			title("RLP positions") ///
			ysize(4.5) name(RLPpos, replace) nodraw
			
			* Figure A2: Positions of included RLPs in the two-dimensional policy space (version with labels for appendix)
			 capture drop pos	
			 gen pos=3
			 replace pos=6 if country_elecyear_party=="CY-2016-AKEL"
			 replace pos=12 if country_elecyear_party=="NL-2006-SP"
			 replace pos=9 if country_elecyear_party=="NL-2002-SP"
			 replace pos=6 if country_elecyear_party=="NL-2003-SP"
			 replace pos=7 if country_elecyear_party=="NL-2017-SP"
			 replace pos=12 if country_elecyear_party=="GR-2007-KKE"
			 replace pos=6 if country_elecyear_party=="GR-2009-KKE"
			 replace pos=7 if country_elecyear_party=="GR-2000-KKE"
			 replace pos=7 if country_elecyear_party=="GR-2000-SYRIZA/SYN"
			 replace pos=1 if country_elecyear_party=="GR-2004-SYRIZA/SYN"
			 replace pos=5 if country_elecyear_party=="GR-2007-SYRIZA/SYN"
			 replace pos=12 if country_elecyear_party=="IT-2013-SEL"	 
			 replace pos=4 if country_elecyear_party=="PT-2002-BE"
			 replace pos=9 if country_elecyear_party=="PT-2005-BE"
			 replace pos=6 if country_elecyear_party=="PT-2011-BE"
			 replace pos=12 if country_elecyear_party=="PT-2005-CDU/PCP/PEV"
			 replace pos=9 if country_elecyear_party=="PT-2009-CDU/PCP/PEV"
			 replace pos=12 if country_elecyear_party=="PT-2015-CDU/PCP/PEV"
			 replace pos=12 if country_elecyear_party=="FI-1999-VAS"	  	 
			 replace pos=7 if country_elecyear_party=="FI-2015-VAS"
			 replace pos=10 if country_elecyear_party=="FR-2007-PCF/FDG"
			 replace pos=12 if country_elecyear_party=="FR-2012-PCF/FDG"
			 replace pos=9 if country_elecyear_party=="FR-2017-FI"
			 replace pos=12 if country_elecyear_party=="BE-2014-PvDA/PTB"
			 replace pos=6 if country_elecyear_party=="BE-2010-PvDA/PTB"
			 replace pos=6 if country_elecyear_party=="SE-2010-V"
			 replace pos=12 if country_elecyear_party=="SE-2014-V"
			 replace pos=12 if country_elecyear_party=="DK-2011-SF"
			 replace pos=1 if country_elecyear_party=="DK-2001-SF"
			 replace pos=2 if country_elecyear_party=="DK-2007-SF"
			 replace pos=4 if country_elecyear_party=="DK-2005-SF"
			 replace pos=12 if country_elecyear_party=="DK-2015-SF"
			 replace pos=11 if country_elecyear_party=="DK-2015-EL"
			 replace pos=7 if country_elecyear_party=="DK-2011-EL"
			 replace pos=7 if country_elecyear_party=="DK-2007-EL"
			 replace pos=3 if country_elecyear_party=="DE-2017-Linke/PDS"
			 replace pos=12 if country_elecyear_party=="DE-2009-Linke/PDS"
			 replace pos=4 if country_elecyear_party=="DE-2002-Linke/PDS"
			 replace pos=3 if country_elecyear_party=="NO-2009-SV"
			 replace pos=8 if country_elecyear_party=="NO-2017-SV"
			 replace pos=12 if country_elecyear_party=="NO-2013-SV"
			 replace pos=6 if country_elecyear_party=="ES-2004-IU"
			 replace pos=6 if country_elecyear_party=="ES-2008-IU"
			 replace pos=5 if country_elecyear_party=="ES-2016-PODEMOS"

			 scatter galtan_filled lrecon_filled, ///
				xlabel(0 (.5) 3.5, gmin gmax) ylabel(0 (1) 6.5, gmin gmax) msymbol(.) msize(tiny) ///
				ytitle(GAL-TAN position) xtitle(economic left-right position) ///
				mlabel(country_elecyear_party) mlabsize(tiny) mlabvpos(pos) mlabgap(0.5) ysize(4.5) name(FigureA2, replace) 
			
			graph export "FigureA2.tif", width(2500) replace	
		restore
		
		* Positions of social classes in two-dimensional policy space
		
		* Measure positions on a 0 to 10 scale
		* economic position measured via attitudes towards "governments should redistribute differences in income levels"
		gen econ=(gincdif-1)*2.5
		label variable econ "economic attittude"
		
		* Cultural positions measured by mean of attitudes towards "gays and lesbians should be free to live life as they wish" and "country's cultural life undermined or enriched by immigrants"
		gen homosex=(freehms-1)*2.5
		gen immcult=-imueclt+10
		gen cult=(homosex+immcult)/2		
		label variable cult "cultural attitude"

		* scatterplot
		capture drop pos	
		gen pos=3
		replace pos=6 if class80_7==2
		replace pos=12 if class80_7==4
		replace pos=9 if class80_7==6
		replace pos=6 if class80_7==5

		
		preserve
		expand 2, generate(duplicates)
		replace class80_7=99 if duplicates==1 & class80_7<.
		label define class80_7 99 "overall mean", add	
		replace pos=3 if class80_7==99

		
		collapse (mean) econ* cult* pos, by(class80_7)
			twoway (scatter cult econ if class80_7!=. & class80_7!=99, mlabel(class8) mlabvpos(pos) mlabgap(tiny) msymbol(D)) ///
				   (scatter cult econ if class80_7==99, mlabel(class8) mlabvpos(pos) mlabgap(tiny) msymbol(O)), ///
				    xtitle(economic position) ytitle(cultural position) xlabel(2.5 (.5) 4) ylabel(2.5 (.5) 4) title("mean positions classes") legend(off) name(classpos, replace) nodraw	 
		restore	


	* Boxplot: relative share of social classes in RLPs' electorates
		preserve 
			drop if voteRLP!=1 | class80_7==.
			
			bysort country_elecyear_party: gen N=_N
			bysort country_elecyear_party class80_7: gen N_class=_N
			gen classproportion=N_class/N

			collapse (mean) N classproportion, by(country_elecyear_party class80_7)
			egen median = median(classproportion), by(class80_7)

			graph box classproportion, over(class80_7, sort(median, ascending) label(angle(forty_five))) ///
				ytitle(" ") ylabel(0 (.1) .5, gmin gmax) ///
				title("proportion of RLP electorate") name(classcomposition, replace) nodraw
				
		restore
		
	* Boxplot: vote share of RLP's across social classes
		preserve 
			drop if class80_7==.	
			bysort country_elecyear_party: gen N=_N
			collapse (mean) N voteRLP, by(country_elecyear_party class80_7)
			egen median = median(voteRLP), by(class80_7)

			graph box voteRLP, over(class80_7, sort(median, ascending) label(angle(forty_five))) ///
				ytitle(" ") ylabel(0 (.1) .5, gmin gmax) ///
				title("RLP vote share in classes") name(RLPshareinclasses, replace) nodraw
				
		restore 

	* Combine individual graphs for Figure 2
		graph combine classpos RLPpos classcomposition RLPshareinclasses, row(2) imargin(small) iscale(*1.0) ysize(6) name(Figure2, replace)
			graph export "Figure2.tif", width(2500) replace
			graph export "Figure2.pdf", replace


*** Figure B2: Positions of occupational classes in two-dimensional policy space by country 
	preserve
	
	collapse (mean) econ* cult*, by(cntry class80_7)
	label define class80_7 1 "SCP" 2 "PW" 3 "SW" 4 "TP" 5 "C" 6 "E&M" 7 "SBO", modify
	levelsof cntry, local(country)
	foreach c of local country {
	display "`c'"
	twoway (scatter cult econ if class80_7==1 & cntry=="`c'", mlabel(class8) mlabpos(0) msymbol(i) mlabcolor(navy)) ///
		   (scatter cult econ if class80_7==2 & cntry=="`c'", mlabel(class8) mlabpos(0) msymbol(i) mlabcolor(orange_red)) ///
		   (scatter cult econ if class80_7>=3 & class80_7<=7 & cntry=="`c'", mlabel(class8) mlabpos(0) msymbol(i) mlabcolor(gs10)) ///
				, xtitle(economic position) ytitle(cultural position) title(`c') legend(off) name(`c', replace) nodraw
	} 

	graph combine BE CY DE DK ES FI FR GR IE IS IT NL NO PT SE, col(3) ///
		imargin(tiny) iscale(*1.3) ysize(9) name(FigureB2, replace)
			graph export "FigureB2.tif", width(2500) replace
	
	restore			
	

*** Figure 3: Cultural positions of RLPs and class differences in voting 	
	* share among production workers vs. share among socio-cultural professionals
		bysort country_elecyear_party: egen mean_voteRLP_PWork = mean(voteRLP) if class80==3
		bysort country_elecyear_party: egen mean_voteRLP_SCProfs = mean(voteRLP) if class80==7

		preserve 
			collapse (mean) galtan_filled mean_voteRLP_PWork mean_voteRLP_SCProfs, by(country_elecyear_party)
			gen mean_voteRLP_PworkvsSCProfs=mean_voteRLP_PWork-mean_voteRLP_SCProfs
			pwcorr mean_voteRLP_PworkvsSCProfs galtan_filled, sig obs
			local rho = r(rho)
			local rho = round(`rho', .01)
			twoway (scatter mean_voteRLP_PworkvsSCProfs galtan_filled, msymbol(X) text(-.09 4.5 "r=`rho' (p=0.014)")) (lfit mean_voteRLP_PworkvsSCProfs galtan_filled), ///
				ytitle(RLP %: prod. workers - socio-cult. professionals) xtitle(GAL vs. TAN position) legend(off) ///
				name(class1, replace) nodraw
		restore	
		

	* share among workers (skilled and unskilled) vs. higher-grade service class
		bysort country_elecyear_party: egen mean_voteRLP_Work = mean(voteRLP) if class5==4 | class5==5
		bysort country_elecyear_party: egen mean_voteRLP_HigherServ = mean(voteRLP) if class5==1

		preserve 
			collapse (mean) galtan_filled mean_voteRLP_Work mean_voteRLP_HigherServ, by(country_elecyear_party)
			gen mean_voteRLP_WorkvsHigherServ=mean_voteRLP_Work-mean_voteRLP_HigherServ
			pwcorr mean_voteRLP_WorkvsHigherServ galtan_filled, sig obs
			local rho = r(rho)
			local rho = round(`rho', .01)
			twoway (scatter mean_voteRLP_WorkvsHigherServ galtan_filled, msymbol(X) text(-.09 4.5 "r=`rho' (p=0.000)")) (lfit mean_voteRLP_WorkvsHigherServ galtan_filled), ///
				ytitle(RLP %: workers - higher-grade service class) xtitle(GAL vs. TAN position) legend(off) ///
				name(class2, replace) nodraw
		restore
			
		graph combine class1 class2, ycommon iscale(*1.8) xsize(7) name(Figure3, replace)
			graph export "Figure3.tif", width(2500) replace
			graph export "Figure3.pdf", replace			
		
		
		
**# Bookmark #3
********************************************************************************
***************** Main multilevel regression models ****************************
********************************************************************************		
	
***** M1: Linear probability model 
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
		gen included=1 if e(sample)
		eststo M1
		
		
	*** Predicted probabilities and AMEs

	* Socio-cultural professionals and production workers
		estimates restore M1	
	margins, at(galtan_filled=(0 (1) 7) class80_7=(1 2)) post
		eststo marg1
		
		estimates restore marg1	
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("GAL vs. TAN position of RLP") title(" ") ///
		plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
		plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
		addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
		ylabel(0 (.02) .18, gmin gmax) legend(off)) ///
		text(.16 3.1 "socio-cultural professionals", color(navy)) ///
		text(.035 3.8 "production workers", color(orange_red)) ///
		name(marg1, replace)
		
		estimates restore M1	
	margins r(1 2).class80_7, at(galtan_filled=(0 (1) 7)) contrast(nowald effects) post
		eststo marg2

		estimates restore marg2	
	marginsplot, ///
			level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("GAL vs. TAN position of RLP") title(" ") ///
			addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			yline(0) ///
			legend(off)) name(marg2, replace)	 
			
			
	* Technical professionals and small business owners
		estimates restore M1	
	margins, at(galtan_filled=(0 (1) 7) class80_7=(4 7)) post
		eststo marg3

		estimates restore marg3	
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("GAL vs. TAN position of RLP") title(" ") ///
		plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
		plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
		addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
		ylabel(0 (.02) .18, gmin gmax) legend(off) ) ///
		text(0.095 4 "technical professionals", color(navy)) ///
		text(.028 4 "small business owners", color(orange_red)) ///
		name(marg3, replace)	

		
	* Service workers, clerks and employers & managers 
		estimates restore M1	
	margins, at(galtan_filled=(0 (1) 7) class80_7=(3 5 6)) post
		eststo marg4
		
		estimates restore marg4	
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("GAL vs. TAN position of RLP") title(" ") ///
		plot1opts(mcolor(orange_red)  lcolor(orange_red)) ci1opts(color(orange_red)) ///
		plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
		plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
		addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
		ylabel(0 (0.02) .18, gmin gmax) legend(off)) ///
		text(0.13 4.7 "service workers", color(orange_red)) ///
		text(.10 1.5 "clerks", color(gs10)) ///
		text(.028 3.5 "employers & managers", color(navy)) ///
		name(marg4, replace)	
			
			
	graph combine marg1 marg2 marg3 marg4, iscale(*1.1) col(2) imargin(zero) ysize(6) name(Figure4, replace)
		graph export "Figure4.tif", width(2500) replace
		graph export "Figure4.pdf", replace
		
	
	* marginal effect of position across classes
		estimates restore M1	
	margins, dydx(galtan_filled) at(class80_7=(1/7)) post
		
	
***** M2: Binary Logit  
/*
	melogit voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7
		eststo M2
		estimates save log_rs, replace
	
		estimates use "log_rs.ster"
		estimates esample: voteRLP class80_7 galtan_filled gender age 
		eststo M2
*/	
	
***** M3: Linear probability model (fixed intercept, random slope model)
	mixed voteRLP ib1.party_elecyear_num i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , nocons vce(robust) stddeviations
		eststo M3		
		
		
****** Regression table	-> Table 1: Results from multilevel regression models
	esttab M1 /* M2 */ M3 using "Table1.rtf", b(a2) se(a2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		varwidth(30) nogaps compress label replace transform(ln*: exp(@) exp(@)) bic	
		
		

**# Bookmark #4		
********************************************************************************
***************** Appendix C: Main Robustness checks for baseline model ********
********************************************************************************
	
***** Figure C1: Cultural positions of RLPs and differences in voting across classes from binary logistic regression (Table 1, model 2) *****
	* M2: Binary Logit -> Predicted probabilities and AMEs

	* Socio-cultural professionals and production workers
	/*
	estimates restore M2	
	margins, at(galtan_filled=(0 (1) 7) class80_7=(1 2)) nose post
		eststo marg_log1
		estimates save marg_log1, replace
		
		estimates use "marg_log1.ster"
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("GAL vs. TAN position of RLP") title(" ") ///
		plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
		plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
		addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(0 (0.05) .2, gmin gmax) ylabel(none, axis(2)) ///
		legend(off)) text(.15 3 "socio-cultural professionals", color(navy)) text(.04 3.5 "production workers", color(orange_red)) ///
		name(logit_1, replace)
	
		estimates restore M2	
	margins r(1 2).class80_7, at(galtan_filled=(0 (1) 7)) contrast(nowald effects) nose post
		eststo marg_log2
		estimates save marg_log2, replace		
		
		estimates use "marg_log2.ster"
	marginsplot, ///
			level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("GAL vs. TAN position of RLP") title(" ") ///
			addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			yline(0) ///
			legend(off)) name(logit_2, replace)	 
			
			
	* Technical professionals and small business owners
		
	estimates restore M2	
	margins, at(galtan_filled=(0 (1) 7) class80_7=(4 7)) nose post
		eststo marg_log3
		estimates save marg_log3, replace
		
		estimates use "marg_log3.ster"
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("GAL vs. TAN position of RLP") title(" ") ///
		plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
		plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
		addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2))  ///
		ylabel(0 (0.05) .2, gmin gmax) ylabel(none, axis(2))) ///
		legend(off) text(0.10 4 "technical professionals", color(navy)) text(.03 4 "small business owners", color(orange_red)) ///
		name(logit_3, replace)	

		
	* Service workers, clerks and employers & managers 

	estimates restore M2	
	margins, at(galtan_filled=(0 (1) 7) class80_7=(3 5 6)) nose post
		eststo marg_log4
		estimates save marg_log4, replace
		
		estimates use "marg_log4.ster"		
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("GAL vs. TAN position of RLP") title(" ") ///
		plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
		plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
		plot3opts(mcolor(gs10) lcolor(gs10)) ci3opts(color(gs10)) ///
		addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
		ylabel(0 (0.05) .2, gmin gmax) ylabel(none, axis(2))) ///
		legend(off) text(0.12 3.5 "service workers", color(navy)) text(.10 3.5 "clerks", color(orange_red)) text(.035 3.5 "employers & managers", color(gs10)) ///
		name(logit_4, replace)	
			
	* Figure C1: Cultural positions of RLPs and differences in voting across classes from binary logistic regression (Table 1, model 2)
	graph combine logit_1 logit_2 logit_3 logit_4, col(2) imargin(zero) ysize(6) name(FigureC1, replace)
	graph export "FigureC1.tif", width(2500) replace
	*/				
	
	
***** Figure C2: Marginal effect of production worker from fixed-intercept, random-slope model (Table 1, model 3) *****
	* M3: Linear probability model (fixed intercept, random slope model) -> AMEs
	* Production workers vs. socio-cultural professionals 
		estimates restore M3		
	margins r(1 2).class80_7, at(galtan_filled=(0 (1) 7)) contrast(nowald effects) post noestimcheck
		eststo marg_FE

		estimates restore marg_FE	
	marginsplot, ///
			level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("GAL vs. TAN position of RLP") title(" ") ///
			addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 15) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			yline(0) ///
			legend(off)) name(FigureC2, replace)	 

			graph export "FigureC2.tif", width(2500) replace

	capture drop included
	
		
**** Table C1: Results from multilevel regression models identifying the effect within country and within RLP *****
	* M1: Linear probability model (fixed intercept, random slope model), control for country X class interactions 
	mixed voteRLP i.party_elecyear_num  i.class80_7##i.country i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , nocons vce(robust) stddeviations
		gen included_TC1_M1=1 if e(sample)
		eststo TC1_M1	
		
	* M2: Linear probability model (fixed intercept, random slope model), control for RLP X class interactions
		/// exclude RLPs observed for only one election
	mixed voteRLP i.party_elecyear_num i.class80_7##i.party_id i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent ///
		if partylab!="FI" & partylab!="PODEMOS" & partylab!="RV" & partylab!="SEL" & partylab!="VG" || country_elecyear_party: i.class80_7 , nocons vce(robust) stddeviations
		gen included_TC1_M2=1 if e(sample)
		eststo TC1_M2	
		
	* Regression table -> Table C1
	esttab TC1_M1 TC1_M2 using "TableC1.rtf", b(a2) se(a2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		varwidth(30) nogaps compress label replace transform(ln*: exp(@) exp(@)) bic
		
	* Figure C3: Marginal effect of production worker from model 1 of Table C1 (with country X class interactions)
		estimates restore TC1_M1		
	margins r(1 2).class80_7, at(galtan_filled=(0 (1) 7)) contrast(nowald effects) post noestimcheck
	
	marginsplot, ///
			level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("GAL vs. TAN position of RLP") title(" ") ///
			addplot(hist galtan_filled if included_TC1_M1==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 15) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			yline(0) ///
			legend(off)) name(FigureC3, replace)	
			
		graph export "FigureC3.tif", width(2500) replace
	
	* Figure C4: Marginal effect of production worker from model 2 of Table C1 (with RLP X class interactions)
		estimates restore TC1_M2		
	margins r(1 2).class80_7, at(galtan_filled=(0 (1) 7)) contrast(nowald effects) post noestimcheck
		
	marginsplot, ///
			level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("GAL vs. TAN position of RLP") title(" ") ///
			addplot(hist galtan_filled if included_TC1_M2==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 15) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			yline(0) ///
			legend(off)) name(FigureC4, replace)	
			
		graph export "FigureC4.tif", width(2500) replace
		
	capture drop included*
	
	
**** Table C2: Regressions with single parties excluded in turn  *****
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="PvDA/PTB" , vce(robust) stddeviations
		eststo M_wo_PvDA	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="AKEL" , vce(robust) stddeviations
		eststo M_wo_AKEL	

	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="Linke/PDS" , vce(robust) stddeviations
		eststo M_wo_LinkePDS
			
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="EL" , vce(robust) stddeviations
		eststo M_wo_EL	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="SF" , vce(robust) stddeviations
		eststo M_wo_SF	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="IU" , vce(robust) stddeviations
		eststo M_wo_IU	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="PODEMOS" , vce(robust) stddeviations
		eststo M_wo_PODEMOS	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="VAS" , vce(robust) stddeviations
		eststo M_wo_VAS	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="FI" , vce(robust) stddeviations
		eststo M_wo_FI	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="PCF/FDG" , vce(robust) stddeviations
		eststo M_wo_PCFFDG
	
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="KKE" , vce(robust) stddeviations
		eststo M_wo_KKE	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="SYRIZA/SYN" , vce(robust) stddeviations
		eststo M_wo_SYRIZASYN
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="PBPA/SPBP" , vce(robust) stddeviations
		eststo M_wo_PBPASPBP	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="SF" , vce(robust) stddeviations
		eststo M_wo_SF	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="VG" , vce(robust) stddeviations
		eststo M_wo_VG	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="PRC/RC" , vce(robust) stddeviations
		eststo M_wo_PRCRC	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="SEL" , vce(robust) stddeviations
		eststo M_wo_SEL	
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="SP" , vce(robust) stddeviations
		eststo M_wo_SP	

	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="RV" , vce(robust) stddeviations
		eststo M_wo_RV
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="SV" , vce(robust) stddeviations
		eststo M_wo_SV
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="BE" , vce(robust) stddeviations
		eststo M_wo_BE

	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="CDU/PCP/PEV" , vce(robust) stddeviations
		eststo M_wo_CDUPCPPEV
		
	mixed voteRLP i.class80_7##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 if partylab!="V" , vce(robust) stddeviations
		eststo M_wo_V
				
		
	* regression tables
	esttab M_wo_PvDA M_wo_AKEL M_wo_LinkePDS M_wo_EL M_wo_SF M_wo_IU M_wo_PODEMOS M_wo_VAS M_wo_FI M_wo_PCFFDG M_wo_KKE M_wo_SYRIZASYN using "TableC2A.rtf", b(a2) se(a2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		varwidth(30) nogaps compress label replace transform(ln*: exp(@) exp(@)) bic			

	esttab M_wo_PBPASPBP M_wo_SF M_wo_VG M_wo_PRCRC M_wo_SEL M_wo_SP M_wo_RV M_wo_SV M_wo_BE M_wo_CDUPCPPEV M_wo_V using "TableC2b.rtf", b(a2) se(a2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		varwidth(30) nogaps compress label replace transform(ln*: exp(@) exp(@)) bic	

		
		
**** Table C3: Regressions with additional interaction between class and economic party position **** 
	* Linear regression of class voting with the interaction & random slope 
	mixed voteRLP i.class80_7##c.galtan_filled i.class80_7##c.lrecon_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
		gen included_withecon=1 if e(sample)
		eststo M_withecon

	* Regression table		
	esttab M_withecon using "TableC3.rtf", b(a2) se(a2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		varwidth(30) nogaps compress label replace transform(ln*: exp(@) exp(@)) bic
	
	
	* Figure C5: Cultural positions of RLPs and differences in voting across classes with additional control for economic position of RLP
	* Predicted probabilities and marginal effects by GAL-TAN

	* Socio-cultural professionals and production workers
		estimates restore M_withecon	
	margins, at(galtan_filled=(0 (1) 7) class80_7=(1 2)) post
		eststo marg1_withecon
		
		estimates restore marg1_withecon	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist galtan_filled if included_withecon==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax) ylabel(none, axis(2)) legend(off)) ///
			text(.17 3.1 "socio-cultural professionals", color(navy)) ///
			text(.045 3.8 "production workers", color(orange_red)) ///
			name(marg1_withecon, replace)
		
		estimates restore M_withecon	
	margins r(1 2).class80_7, at(galtan_filled=(0 (1) 7)) contrast(nowald effects) post
		eststo marg2_withecon

		estimates restore marg2_withecon	
	marginsplot, ///
			level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("GAL vs. TAN position of RLP") title(" ") ///
			addplot(hist galtan_filled if included_withecon==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			yline(0) ///
			legend(off)) name(marg2_withecon, replace)	 
			
			
	* Technical professionals and small business owners
		estimates restore M_withecon	
	margins, at(galtan_filled=(0 (1) 7) class80_7=(4 7)) post
		eststo marg3_withecon

		estimates restore marg3_withecon	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist galtan_filled if included_withecon==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(none, axis(2)) ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.10 3 "technical professionals", color(navy)) ///
			text(.03 4 "small business owners", color(orange_red)) ///
			name(marg3_withecon, replace)

		
	* Service workers, clerks and employers & managers 
		estimates restore M_withecon	
	margins, at(galtan_filled=(0 (1) 7) class80_7=(3 5 6)) post
		eststo marg4_withecon
		
		estimates restore marg4_withecon	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(orange_red) lcolor(orange_red)) ci1opts(color(orange_red)) ///
			plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
			plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
			addplot(hist galtan_filled if included_withecon==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.12 4 "service workers", color(orange_red)) ///
			text(.10 1.5 "clerks", color(gs10)) ///
			text(.035 3.5 "employers & managers", color(navy)) ///	
			name(marg4_withecon, replace)
			
			
	graph combine marg1_withecon marg2_withecon marg3_withecon marg4_withecon, col(2) imargin(zero) ysize(6) name(FigureC5, replace)
		graph export "FigureC5.tif", width(2500) replace

	
	* Figure C6: Economic positions of RLPs and differences in voting across classes 
	* Predicted probabilities and marginal effects by economic position

		* Socio-cultural professionals and production workers
		estimates restore M_withecon	
	margins, at(lrecon_filled=(0 (1) 4) class80_7=(1 2)) post
		eststo marg1_forecon
		
		estimates restore marg1_forecon	
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("economic position of RLP") title(" ") ///
		plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
		plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
		addplot(hist lrecon_filled if included_withecon==1, xlabel(0 (1) 3, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 40) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ylabel(0 (0.05) .25, gmin gmax) ///
		legend(off)) text(.22 1.7 "socio-cultural professionals", color(navy)) text(.055 2.5 "production workers", color(orange_red)) ///
		name(marg1_forecon, replace)
		
		estimates restore M_withecon	
	margins r(1 2).class80_7, at(lrecon_filled=(0 (1) 4)) contrast(nowald effects) post
		eststo marg2_forecon

		estimates restore marg2_forecon	
	marginsplot, ///
			level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("economic position of RLP") title(" ") ///
			addplot(hist lrecon_filled if included_withecon==1, xlabel(0 (1) 3, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 40) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			yline(0) ///
			legend(off)) name(marg2_forecon, replace)	 
			
			
	* Technical professionals and small business owners
		estimates restore M_withecon	
	margins, at(lrecon_filled=(0 (1) 4) class80_7=(4 7)) post
		eststo marg3_forecon

		estimates restore marg3_forecon	
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("economic position of RLP") title(" ") ///
		plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
		plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
		addplot(hist lrecon_filled if included_withecon==1, xlabel(0 (1) 3, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 40) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
		ylabel(0 (0.05) .25, gmin gmax)) ///
		legend(off) text(0.15 1.5 "technical professionals", color(navy)) text(.03 2.5 "small business owners", color(orange_red)) ///
		name(marg3_forecon, replace)	

		
	* Service workers, clerks and employers & managers 
		estimates restore M_withecon	
	margins, at(lrecon_filled=(0 (1) 4) class80_7=(3 5 6)) post
		eststo marg4_forecon
		
		estimates restore marg4_forecon	
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("economic position of RLP") title(" ") ///
		plot1opts(mcolor(orange_red) lcolor(orange_red)) ci1opts(color(orange_red)) ///
		plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
		plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
		addplot(hist lrecon_filled if included_withecon==1, xlabel(0 (1) 3, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 40) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
		ylabel(0 (0.05) .25, gmin gmax)) ///
		legend(off) text(0.15 1.5 "service workers", color(orange_red)) text(.10 1.0 "clerks", color(gs10)) text(.033 2.5 "employers & managers", color(navy)) ///
		name(marg4_forecon, replace)	
			
			
	graph combine marg1_forecon marg2_forecon marg3_forecon marg4_forecon, xcommon col(2) imargin(zero) ysize(6) name(FigureC6, replace)
		graph export "FigureC6.tif", width(2500) replace

		
		
**** Table C4: Regressions with three-way interaction between class, GAL-TAN positions of RLPs and vote share of radical-right parties (RRPs) in election  **** 
	* Linear probability model 
	mixed voteRLP i.class80_7##c.galtan_filled##c.RRP_voteshare i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
		gen included_RRP=1 if e(sample)
		eststo M_withRRP
	
	* Regression table		
	esttab M_withRRP using "TableC4.rtf", b(a2) se(a2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		varwidth(30) nogaps compress label replace transform(ln*: exp(@) exp(@)) bic	
		
	*** Figure C7: Marginal effect of production worker from model 2 of Table C4 for different values of vote shares of radical-right parties 
		estimates restore M_withRRP	
	margins r(1 2).class80_7, at(galtan_filled=(0 (1) 7) RRP_voteshare=(0)) contrast(nowald effects) post
		eststo marg1_withRRP

		estimates restore marg1_withRRP	
	marginsplot, ///
			level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("GAL vs. TAN position of RLP") title(" ") ///
			addplot(hist galtan_filled if included_RRP==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			title("with RRP vote share = 0%") ///
			yline(0) ///
			legend(off)) name(marg1_withRRP, replace)	 
			
		estimates restore M_withRRP	
	margins r(1 2).class80_7, at(galtan_filled=(0 (1) 7) RRP_voteshare=(0.16)) contrast(nowald effects) post
		eststo marg2_withRRP

		estimates restore marg2_withRRP	
	marginsplot, ///
			level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("GAL vs. TAN position of RLP") title(" ") ///
			addplot(hist galtan_filled if included_RRP==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			title("with RRP vote share = 16%") ///
			yline(0) ///
			legend(off)) name(marg2_withRRP, replace)	 			
			
	graph combine marg1_withRRP marg2_withRRP, ycommon imargin(zero) iscale(*1.7) xsize(8) name(FigureC7, replace)		
		graph export "FigureC7.tif", width(2500) replace
	
	

**# Bookmark #5
********************************************************************************
***************** Appendix D: Results for education ****************************
********************************************************************************			

*** Figure D1: Cultural positions of RLPs and differences in voting across education groups 
	* share among lower educated (Less than lower secondary education & Lower secondary education completed) vs. high educated 
	bysort country_elecyear_party: egen mean_voteRLP_lowerEDU = mean(voteRLP) if edulvla==1 | edulvla==2 
	* share among high educated 
	bysort country_elecyear_party: egen mean_voteRLP_highEDU = mean(voteRLP) if edulvla==5

	preserve 
	collapse (mean) galtan_filled mean_voteRLP_lowerEDU mean_voteRLP_highEDU, by(country_elecyear_party)
	gen mean_voteRLP_EDUlowervshigh=mean_voteRLP_lowerEDU-mean_voteRLP_highEDU
	pwcorr mean_voteRLP_EDUlowervshigh galtan_filled, sig
	local rho = r(rho)
	local rho = round(`rho', .01)
	twoway (scatter mean_voteRLP_EDUlowervshigh galtan_filled, msymbol(X) text(-.09 3.5 "r=`rho' (p=0.0003)") ylabel(-.1 (0.05) .3) xlabel(0/6)) (lfit mean_voteRLP_EDUlowervshigh galtan_filled), ///
		ytitle("RLP %: lower education - high education") xtitle(GAL vs. TAN position) legend(off) ///
		name(education2, replace)
	restore	
	
	* Figure D1: Cultural positions of RLPs and differences in voting across education groups
	graph combine education2, iscale(*1.4) xsize(7) name(FigureD1, replace)
		graph export "FigureD1.tif", width(2500) replace
		
	
	*** Table D1: Regression models for education 
	
	*** Random intercept, random slope model
	mixed voteRLP i.education##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.education , vce(robust) stddeviations
		gen included_edu=1 if e(sample)
		eststo M1_edu
	
	*** Fixed intercept, random slope model
	mixed voteRLP ib1.party_elecyear_num i.education##c.galtan_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.education , nocons vce(robust) stddeviations
		eststo M2_edu

	* Regression table	
	esttab M1_edu M2_edu using "TableD1.rtf", b(a2) se(a2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		varwidth(30) nogaps compress label replace transform(ln*: exp(@) exp(@)) bic


	* Figure D2: Predicted probability and marginal effect of an RLP vote across GAL-TAN positions for education
		estimates restore M1_edu	
	margins, at(galtan_filled=(0 (1) 7) education=(0 1 2)) post
		eststo edu_marg1
		
		estimates restore edu_marg1	
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("GAL vs. TAN position of RLP") title(" ") ///
		plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
		plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
		plot3opts(mcolor(orange_red) lcolor(orange_red)) ci3opts(color(orange_red)) ///
		addplot(hist galtan_filled if included_edu==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
		legend(off)) text(.12 1.5 "high education", color(navy)) text(.15 5.5 "low education", color(orange_red))  text(.045 3.5 "medium education", color(gs10)) ///
		ylabel(0 (0.05) .15, gmin gmax) ///
		name(edu_marg1, replace)
		
		estimates restore M1_edu	
	margins r(0 2).education, at(galtan_filled=(0 (1) 7)) contrast(nowald effects) post
		eststo edu_marg2

		estimates restore edu_marg2	
	marginsplot, ///
			level(95) ytitle("AME: low educated vs. high educated") xtitle("GAL vs. TAN position of RLP") title(" ") ///
			addplot(hist galtan_filled if included_edu==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			yline(0) ///
			legend(off)) name(edu_marg2, replace)	 
				
			
	graph combine edu_marg1 edu_marg2, col(1) iscale(*1.2) imargin(zero) ysize(6) name(FigureD2, replace)
		graph export "FigureD2.tif", width(2500) replace
	

**# Bookmark #6
********************************************************************************
****** Appendix E: Results for other party position measures *******************
********************************************************************************	

*** Tables E1 & E2
	preserve 
		collapse (last) cntry election_year country_elecyear party_id partylab (rawsum) voteRLP_tot=voteRLP (mean) voteRLP_share=voteRLP *filled (count) N=party_id, by(country_elecyear_party)
					
	* Table E1: Factor analysis of party position items
		factor galtan_filled civlib_laworder_filled sociallifestyle_filled immigrate_policy_filled multiculturalism_filled ethnic_minorities_filled, pcf

	* Table E2: Correlation between party position measures
		pwcorr galtan_filled cult_mean_filled civlib_laworder_filled sociallifestyle_filled immigrate_policy_filled multiculturalism_filled ethnic_minorities_filled eu_position_filled lrecon_filled
	restore
	
	
*** Table E3: Regressions with alternative position items 
	*** Cultural mean
		mixed voteRLP i.class80_7##c.cult_mean_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
			gen included_cultmean=1 if e(sample)
			eststo M_cultmean
			
	*** Civil liberties & law and order
		mixed voteRLP i.class80_7##c.civlib_laworder_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
			gen included_civlib=1 if e(sample)
			eststo M_civlib	
		
	*** Social lifestyle
		mixed voteRLP i.class80_7##c.sociallifestyle_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
			gen included_lifestyle=1 if e(sample)
			eststo M_lifestyle		

	*** Immigration policy	
		mixed voteRLP i.class80_7##c.immigrate_policy_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
			gen included_immigr=1 if e(sample)
			eststo M_immigr		
		
	*** Multiculturalism	
		mixed voteRLP i.class80_7##c.multiculturalism_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
			gen included_multicult=1 if e(sample)
			eststo M_multicult	
		
	*** Ethnic minorities	
		mixed voteRLP i.class80_7##c.ethnic_minorities_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
			gen included_minor=1 if e(sample)
			eststo M_minor	
		
	*** EU position	
		mixed voteRLP i.class80_7##c.eu_position_filled i.gender c.age_incent##c.age_incent || country_elecyear_party: i.class80_7 , vce(robust) stddeviations
			gen included_eu=1 if e(sample)
			eststo M_eu		
		
	*** Regression table	
		esttab M_cultmean M_civlib M_lifestyle M_immigr M_multicult M_minor M_eu using "TableE3.rtf", b(a2) se(a2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
			varwidth(30) nogaps compress label replace transform(ln*: exp(@) exp(@)) bic
	
	
	
*** Predicted probabilities and AMEs
	*** Figure E1: Predicted probability and marginal effect of an RLP vote across cultural positions (mean index)
		* Socio-cultural professionals and production workers
			estimates restore M_cultmean	
		margins, at(cult_mean_filled=(0 (1) 6) class80_7=(1 2)) post
			eststo marg1
			
			estimates restore marg1	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist cult_mean_filled if included_cultmean==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax) ylabel(none, axis(2)) legend(off)) ///
			text(.18 3.1 "socio-cultural professionals", color(navy)) ///
			text(.045 3.8 "production workers", color(orange_red)) ///
			name(marg1, replace)
			
			estimates restore M_cultmean	
		margins r(1 2).class80_7, at(cult_mean_filled=(0 (1) 6)) contrast(nowald effects) post
			eststo marg2

			estimates restore marg2	
		marginsplot, ///
				level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("position of RLP") title(" ") ///
				addplot(hist cult_mean_filled if included_cultmean==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
				yline(0) ///
				legend(off)) name(marg2, replace)	 			
				
		* Technical professionals and small business owners
			estimates restore M_cultmean	
		margins, at(cult_mean_filled=(0 (1) 6) class80_7=(4 7)) post
			eststo marg3

			estimates restore marg3	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist cult_mean_filled if included_cultmean==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(none, axis(2)) ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.11 3 "technical professionals", color(navy)) ///
			text(.03 3 "small business owners", color(orange_red)) ///
			name(marg3, replace)	
			
		* Service workers, clerks and employers & managers 
			estimates restore M_cultmean	
		margins, at(cult_mean_filled=(0 (1) 6) class80_7=(3 5 6)) post
			eststo marg4
			
			estimates restore marg4	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(orange_red) lcolor(orange_red)) ci1opts(color(orange_red)) ///
			plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
			plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
			addplot(hist cult_mean_filled if included_cultmean==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.14 4 "service workers", color(orange_red)) ///
			text(.10 1.5 "clerks", color(gs10)) ///
			text(.035 3.5 "employers & managers", color(navy)) ///	
			name(marg4, replace)	
				
		graph combine marg1 marg2 marg3 marg4, col(2) imargin(zero) ysize(6) name(FigureE1, replace)
			graph export "FigureE1.tif", width(2500) replace	

			
	*** Figure E2: Predicted probability and marginal effect of an RLP vote across positions on civil liberties vs. law & order
		* Socio-cultural professionals and production workers
			estimates restore M_civlib	
		margins, at(civlib_laworder_filled=(0 (1) 6) class80_7=(1 2)) post
			eststo marg1
			
			estimates restore marg1	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist civlib_laworder_filled if included_civlib==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax) ylabel(none, axis(2)) legend(off)) ///
			text(.18 3.1 "socio-cultural professionals", color(navy)) ///
			text(.045 3.8 "production workers", color(orange_red)) ///
			name(marg1, replace)
			
			estimates restore M_civlib	
		margins r(1 2).class80_7, at(civlib_laworder_filled=(0 (1) 6)) contrast(nowald effects) post
			eststo marg2

			estimates restore marg2	
		marginsplot, ///
				level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("position of RLP") title(" ") ///
				addplot(hist civlib_laworder_filled if included_civlib==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
				yline(0) ///
				legend(off)) name(marg2, replace)	 				
				
		* Technical professionals and small business owners
			estimates restore M_civlib	
		margins, at(civlib_laworder_filled=(0 (1) 6) class80_7=(4 7)) post
			eststo marg3

			estimates restore marg3	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist civlib_laworder_filled if included_civlib==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(none, axis(2)) ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.11 3 "technical professionals", color(navy)) ///
			text(.03 3 "small business owners", color(orange_red)) ///
			name(marg3, replace)	
			
		* Service workers, clerks and employers & managers 
			estimates restore M_civlib	
		margins, at(civlib_laworder_filled=(0 (1) 6) class80_7=(3 5 6)) post
			eststo marg4
			
			estimates restore marg4	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(orange_red) lcolor(orange_red)) ci1opts(color(orange_red)) ///
			plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
			plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
			addplot(hist civlib_laworder_filled if included_civlib==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.14 4 "service workers", color(orange_red)) ///
			text(.10 1.5 "clerks", color(gs10)) ///
			text(.035 3.5 "employers & managers", color(navy)) ///	
			name(marg4, replace)						
				
		graph combine marg1 marg2 marg3 marg4, col(2) imargin(zero) ysize(6) name(FigureE2, replace)
			graph export "FigureE2.tif", width(2500) replace		
		

	*** Figure E3: Predicted probability and marginal effect of an RLP vote across positions on social lifestyle
		* Socio-cultural professionals and production workers
			estimates restore M_lifestyle	
		margins, at(sociallifestyle_filled=(0 (1) 7) class80_7=(1 2)) post
			eststo marg1
			
			estimates restore marg1	
			mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist sociallifestyle_filled if included_lifestyle==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax) ylabel(none, axis(2)) legend(off)) ///
			text(.18 3.1 "socio-cultural professionals", color(navy)) ///
			text(.045 3.8 "production workers", color(orange_red)) ///
			name(marg1, replace)
			
			estimates restore M_lifestyle	
		margins r(1 2).class80_7, at(sociallifestyle_filled=(0 (1) 7)) contrast(nowald effects) post
			eststo marg2

			estimates restore marg2	
		marginsplot, ///
				level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("position of RLP") title(" ") ///
				addplot(hist sociallifestyle_filled if included_lifestyle==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
				yline(0) ///
				legend(off)) name(marg2, replace)	 			
				
		* Technical professionals and small business owners
			estimates restore M_lifestyle	
		margins, at(sociallifestyle_filled=(0 (1) 7) class80_7=(4 7)) post
			eststo marg3

			estimates restore marg3	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist sociallifestyle_filled if included_lifestyle==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(none, axis(2)) ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.11 3 "technical professionals", color(navy)) ///
			text(.03 3 "small business owners", color(orange_red)) ///
			name(marg3, replace)
			
		* Service workers, clerks and employers & managers 
			estimates restore M_lifestyle	
		margins, at(sociallifestyle_filled=(0 (1) 7) class80_7=(3 5 6)) post
			eststo marg4
			
			estimates restore marg4	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(orange_red) lcolor(orange_red)) ci1opts(color(orange_red)) ///
			plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
			plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
			addplot(hist sociallifestyle_filled if included_lifestyle==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.14 4 "service workers", color(orange_red)) ///
			text(.10 1.5 "clerks", color(gs10)) ///
			text(.035 3.5 "employers & managers", color(navy)) ///	
			name(marg4, replace)					
				
		graph combine marg1 marg2 marg3 marg4, col(2) imargin(zero) ysize(6) name(FigureE3, replace)
			graph export "FigureE3.tif", width(2500) replace	
			
			
	*** Figure E4: Predicted probability and marginal effect of an RLP vote across positions on immigration policy
		* Socio-cultural professionals and production workers
			estimates restore M_immigr	
		margins, at(immigrate_policy_filled=(0 (1) 6) class80_7=(1 2)) post
			eststo marg1
			
			estimates restore marg1	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist immigrate_policy_filled if included_immigr==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax) ylabel(none, axis(2)) legend(off)) ///
			text(.18 3.1 "socio-cultural professionals", color(navy)) ///
			text(.045 3.8 "production workers", color(orange_red)) ///
			name(marg1, replace)
			
			estimates restore M_immigr	
		margins r(1 2).class80_7, at(immigrate_policy_filled=(0 (1) 6)) contrast(nowald effects) post
			eststo marg2

			estimates restore marg2	
		marginsplot, ///
				level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("position of RLP") title(" ") ///
				addplot(hist immigrate_policy_filled if included_immigr==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
				yline(0) ///
				legend(off)) name(marg2, replace)	 		
				
		* Technical professionals and small business owners
			estimates restore M_immigr	
		margins, at(immigrate_policy_filled=(0 (1) 6) class80_7=(4 7)) post
			eststo marg3

			estimates restore marg3	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist immigrate_policy_filled if included_immigr==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(none, axis(2)) ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.11 3 "technical professionals", color(navy)) ///
			text(.03 3 "small business owners", color(orange_red)) ///
			name(marg3, replace)
			
		* Service workers, clerks and employers & managers 
			estimates restore M_immigr	
		margins, at(immigrate_policy_filled=(0 (1) 6) class80_7=(3 5 6)) post
			eststo marg4
			
			estimates restore marg4	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(orange_red) lcolor(orange_red)) ci1opts(color(orange_red)) ///
			plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
			plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
			addplot(hist immigrate_policy_filled if included_immigr==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.14 4 "service workers", color(orange_red)) ///
			text(.10 1.5 "clerks", color(gs10)) ///
			text(.035 3.5 "employers & managers", color(navy)) ///	
			name(marg4, replace)					
				
		graph combine marg1 marg2 marg3 marg4, col(2) imargin(zero) ysize(6) name(FigureE4, replace)
			graph export "FigureE4.tif", width(2500) replace		


	*** Figure E5: Predicted probability and marginal effect of an RLP vote across positions on multiculturalism
		* Socio-cultural professionals and production workers
			estimates restore M_multicult	
		margins, at(multiculturalism_filled=(0 (1) 7) class80_7=(1 2)) post
			eststo marg1
			
			estimates restore marg1	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist multiculturalism_filled if included_multicult==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax) ylabel(none, axis(2)) legend(off)) ///
			text(.18 3.1 "socio-cultural professionals", color(navy)) ///
			text(.045 3.8 "production workers", color(orange_red)) ///
			name(marg1, replace)
			
			estimates restore M_multicult	
		margins r(1 2).class80_7, at(multiculturalism_filled=(0 (1) 7)) contrast(nowald effects) post
			eststo marg2

			estimates restore marg2	
		marginsplot, ///
				level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("position of RLP") title(" ") ///
				addplot(hist multiculturalism_filled if included_multicult==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
				yline(0) ///
				legend(off)) name(marg2, replace)	 				
				
		* Technical professionals and small business owners
			estimates restore M_multicult	
		margins, at(multiculturalism_filled=(0 (1) 7) class80_7=(4 7)) post
			eststo marg3

			estimates restore marg3	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist multiculturalism_filled if included_multicult==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(none, axis(2)) ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.11 3 "technical professionals", color(navy)) ///
			text(.03 3 "small business owners", color(orange_red)) ///
			name(marg3, replace)	
				
			
		* Service workers, clerks and employers & managers 
			estimates restore M_multicult	
		margins, at(multiculturalism_filled=(0 (1) 7) class80_7=(3 5 6)) post
			eststo marg4
			
			estimates restore marg4	
	mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(orange_red) lcolor(orange_red)) ci1opts(color(orange_red)) ///
			plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
			plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
			addplot(hist multiculturalism_filled if included_multicult==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.14 4 "service workers", color(orange_red)) ///
			text(.10 1.5 "clerks", color(gs10)) ///
			text(.035 3.5 "employers & managers", color(navy)) ///	
			name(marg4, replace)		
				
		graph combine marg1 marg2 marg3 marg4, col(2) imargin(zero) ysize(6) name(FigureE5, replace)
			graph export "FigureE5.tif", width(2500) replace	

			
	*** Figure E6: Predicted probability and marginal effect of an RLP vote across positions on ethnic minorities
		* Socio-cultural professionals and production workers
			estimates restore M_minor	
		margins, at(ethnic_minorities_filled=(0 (1) 6) class80_7=(1 2)) post
			eststo marg1
			
			estimates restore marg1	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist ethnic_minorities_filled if included_minor==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax) ylabel(none, axis(2)) legend(off)) ///
			text(.18 3.1 "socio-cultural professionals", color(navy)) ///
			text(.045 3.8 "production workers", color(orange_red)) ///
			name(marg1, replace)
			
			estimates restore M_minor	
		margins r(1 2).class80_7, at(ethnic_minorities_filled=(0 (1) 6)) contrast(nowald effects) post
			eststo marg2

			estimates restore marg2	
		marginsplot, ///
				level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("position of RLP") title(" ") ///
				addplot(hist ethnic_minorities_filled if included_minor==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
				yline(0) ///
				legend(off)) name(marg2, replace)	 			
				
		* Technical professionals and small business owners
			estimates restore M_minor	
		margins, at(ethnic_minorities_filled=(0 (1) 6) class80_7=(4 7)) post
			eststo marg3

			estimates restore marg3	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist ethnic_minorities_filled if included_minor==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(none, axis(2)) ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.11 3 "technical professionals", color(navy)) ///
			text(.03 3 "small business owners", color(orange_red)) ///
			name(marg3, replace)	
			
		* Service workers, clerks and employers & managers 
			estimates restore M_minor	
		margins, at(ethnic_minorities_filled=(0 (1) 6) class80_7=(3 5 6)) post
			eststo marg4
			
			estimates restore marg4	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(orange_red) lcolor(orange_red)) ci1opts(color(orange_red)) ///
			plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
			plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
			addplot(hist ethnic_minorities_filled if included_minor==1, xlabel(0 (1) 6, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.14 4 "service workers", color(orange_red)) ///
			text(.10 1.5 "clerks", color(gs10)) ///
			text(.035 3.5 "employers & managers", color(navy)) ///	
			name(marg4, replace)					
				
		graph combine marg1 marg2 marg3 marg4, col(2) imargin(zero) ysize(6) name(FigureE6, replace)
			graph export "FigureE6.tif", width(2500) replace
			

	*** Figure E7: Predicted probability and marginal effect of an RLP vote across positions on EU integration
		* Socio-cultural professionals and production workers
			estimates restore M_eu 
		margins, at(eu_position_filled=(2 (1) 7) class80_7=(1 2)) post
			eststo marg1
			
			estimates restore marg1	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist eu_position_filled if included_eu==1, xlabel(2 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax) ylabel(none, axis(2)) legend(off)) ///
			text(.16 5 "socio-cultural professionals", color(navy)) ///
			text(.045 3.8 "production workers", color(orange_red)) ///
			name(marg1, replace)
			
			estimates restore M_eu	
		margins r(1 2).class80_7, at(eu_position_filled=(2 (1) 7)) contrast(nowald effects) post
			eststo marg2

			estimates restore marg2	
		marginsplot, ///
				level(95) ytitle("AME: prod. worker vs. socio-cult. prof.") xtitle("position of RLP") title(" ") ///
				addplot(hist eu_position_filled if included_eu==1, xlabel(2 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
				yline(0) ///
				legend(off)) name(marg2, replace)	 	
				
		* Technical professionals and small business owners
			estimates restore M_eu	
		margins, at(eu_position_filled=(2 (1) 7) class80_7=(4 7)) post
			eststo marg3

			estimates restore marg3	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
			plot2opts(mcolor(orange_red) lcolor(orange_red)) ci2opts(color(orange_red)) ///
			addplot(hist eu_position_filled if included_eu==1==1, xlabel(2 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ///
			ylabel(none, axis(2)) ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.13 5 "technical professionals", color(navy)) ///
			text(.029 4 "small business owners", color(orange_red)) ///
			name(marg3, replace)	
		
		* Service workers, clerks and employers & managers 
			estimates restore M_eu	
		margins, at(eu_position_filled=(2 (1) 7) class80_7=(3 5 6)) post
			eststo marg4
			
			estimates restore marg4	
		mplotoffset,  ///
			level(84) ytitle("predicted probability") xtitle("position of RLP") title(" ") ///
			plot1opts(mcolor(orange_red) lcolor(orange_red)) ci1opts(color(orange_red)) ///
			plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
			plot3opts(mcolor(navy) lcolor(navy)) ci3opts(color(navy)) ///
			addplot(hist eu_position_filled if included_eu==1==1, xlabel(2 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
			ylabel(0 (0.02) .18, gmin gmax)) legend(off) ///
			text(0.13 5.5 "service workers", color(orange_red)) ///
			text(.10 5.5 "clerks", color(gs10)) ///
			text(.035 4 "employers & managers", color(navy)) ///	
			name(marg4, replace)			
				
		graph combine marg1 marg2 marg3 marg4, col(2) imargin(zero) ysize(6) name(FigureE7, replace)
			graph export "FigureE7.tif", width(2500) replace
		
		
		
**# Bookmark #7		
********************************************************************************
****** Appendix F: Controlling for individuals' policy attitudes ***************
********************************************************************************	

*** Table F1: Regressions with individuals' policy attitudes included  
	mixed voteRLP i.class80_7##c.galtan_filled c.cult##c.galtan_filled i.gender c.age_incent##c.age_incent econ || country_elecyear_party: i.class80_7 c.cult, vce(robust) stddeviations
		gen included_attitudes=1 if e(sample)
		eststo M_attitudes

	* regression table	
	esttab M_attitudes using "TableF1.rtf", b(a2) se(a2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		varwidth(30) nogaps compress label replace transform(ln*: exp(@) exp(@)) bic
		
		
*** Figure F1: Predicted probability of an RLP vote across RLPs GAL-TAN positions for culturally libertarian, centrist and authoritarian individuals
	sum cult if e(sample), detail

		estimates restore M_attitudes	
	margins, at(galtan_filled=(0 (1) 7) cult=(1 2.75 5.75)) post
		eststo marg1
		
		estimates restore marg1	
	mplotoffset,  ///
		level(84) ytitle("predicted probability") xtitle("GAL vs. TAN position of RLP") title(" ") ///
		plot1opts(mcolor(navy)  lcolor(navy)) ci1opts(color(navy)) ///
		plot2opts(mcolor(gs10) lcolor(gs10)) ci2opts(color(gs10)) ///
		plot3opts(mcolor(orange_red) lcolor(orange_red)) ci3opts(color(orange_red)) ///
		addplot(hist galtan_filled if included==1, xlabel(0 (1) 7, gmin gmax) percent discrete yaxis(2) yscale(alt range(0 30) axis(2)) ytitle(" ", axis(2)) ylabel(none, axis(2)) ///
		ylabel(0 (.02) .12, gmin gmax) legend(off)) ///
		text(.11 3.5 "culturally libertarian", color(navy)) ///
		text(.05 1.5 "culturally centrist", color(gs10)) ///
		text(.035 4.5 "culturally authoritarian", color(orange_red)) ///
		scale(*1.1) name(FigureF1, replace)
		
		graph export "FigureF1.tif", width(2500) replace
